package com.lz.core.tcp;

import io.vertx.core.Vertx;
import io.vertx.core.net.NetServer;
import io.vertx.core.net.NetServerOptions;

/**
 * TcpServer..
 *
 * @author Lizhong
 * @date 2020/5/29
 */
public class TcpServer   {
    public static void method01(){
        Vertx vertx = Vertx.vertx();
        NetServerOptions netServerOptions = new NetServerOptions();
        netServerOptions.setLogActivity(true).setPort(1568);
        NetServer netServer = vertx
                .createNetServer(netServerOptions)
                .connectHandler(h->{
                    h.handler(h::write);
                })
                .listen();
    }


    public static void main(String[] args) {
        method01();
    }
}
